const mongoose = require('mongoose');

require("../db/model/order");


// 数据
const orderData = {
  orderTime: '2006-10-30 03:10:35',
  totalPrice: 30,
  userId: "619f3ab8696734775cca8b19",
  commodities: [
    {
      seckill_id: "619ee6d4ec8da821fc63fbe6",
      count: 1
    },
    {
      seckill_id: "619ee6d4ec8da821fc63fbe7",
      count: 2
    }
  ],
  isPaySuccess: 1,
  isAffirmReceive: 0,

}

mongoose.connect(
  "mongodb://tangzhenhua:Lovo123456@182.92.214.223:8084/chenpengProject3",
  {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    auth: { authSource: "admin" }
  },
  async () => {
    const orderModel = mongoose.model("order");
    await orderModel.create(orderData);
  }
)